package cn.lg.soar.message.service.impl;

import cn.lg.soar.common.util.current.CurrentProxy;
import cn.lg.soar.message.entity.NoticeRecipient;
import cn.lg.soar.message.mapper.NoticeRecipientMapper;
import cn.lg.soar.message.service.INoticeRecipientService;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

import java.util.List;

/**
 * @author luguoxiang
 * 开源项目：https://gitee.com/lgx1992/lg-soar 求star！请给我star！请帮我点个star！
 */
public class NoticeRecipientServiceImpl extends ServiceImpl<NoticeRecipientMapper, NoticeRecipient> implements INoticeRecipientService, CurrentProxy<INoticeRecipientService> {

    @Override
    public List<NoticeRecipient> listByNoticeId(Long id) {
        return list(
                Wrappers.<NoticeRecipient>lambdaQuery()
                        .select(
                                NoticeRecipient::getId,
                                NoticeRecipient::getUserId,
                                NoticeRecipient::getStatus,
                                NoticeRecipient::getReadTime
                        )
                        .eq(NoticeRecipient::getNoticeId, id)
        );
    }
}
